/*
  未解决！！！
 */

var addTowNumbers = function (l1, l2) {
    let temp = new ListNode('head');
    let add = 0;
    let sum = 0;
    while (l1 || l2) {
        sum = (l1 ? l1.val : 0) + (l2 ? l2.val : 0);
        temp.next = new ListNode(sum % 10);
        temp = temp.next;
        add = sum >= 10 ? 1 : 0;
        l1 && (l1 = l1.next);
        l2 && (l2 = l2.next);
    }
    add && (temp.next = new ListNode(add));
}

function ListNode(val) {
    this.val = val;
    this.next = null;
}